<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:util="http://java.sun.com/jsf/composite/util">
	
	<util:label grid="5" value="#{i18n.DescricaoEstendida_CodigoDescricao}" />
	<util:label grid="12" value="#{i18n.DescricaoEstendida_Nome}" />
	<div class="grid_5">
		<p:inputText value="#{deBean.deInstance.codigo}" id="campoCodigo" styleClass="width_4" disabled="true" />
	</div>
	<div class="grid_12">
		<p:inputText value="#{deBean.deInstance.nome}" id="campoNome" styleClass="width_12" disabled="true" />
	</div>
	
	<div class="grid_17">
		<br/>
		<p:dataTable id="dataTableDados" widgetVar="dataTableDados" value="#{deBean.dadoList}"
			var="model" paginator="true" lazy="true" dynamic="true" 
			paginatorPosition="#{contextoBean.paginatorPosition}" 
			rows="#{contextoBean.dataTableRows}" paginatorTemplate="#{contextoBean.paginatorTemplate}"
			selection="#{deBean.dadosSelecionados}" rowsPerPageTemplate="#{contextoBean.rowsPerPage}">
			<f:facet name="header">
				<h:outputText style="float:left;" value="Tipos de Dados" />
				<p:commandButton action="#{deBean.preExcluirDado}" update=":formExcluirDado"
					rendered="#{deBean.deInstance.id != null}"
					onstart="spinner.show();" oncomplete="spinner.hide(); "
					icon="ui-icon ui-icon-trash" value="#{i18n.btn_Excluir}" style="float:right"/>
				<p:commandButton action="#{deBean.preNovoDado}" update=":formNovoDado" 
					rendered="#{deBean.deInstance.id != null}"
					onstart="spinner.show();" oncomplete="spinner.hide();dialogoNovoDado.show();"
					icon="ui-icon ui-icon-plus" value="#{i18n.btn_Novo}" style="float:right"/>
			</f:facet>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_NomeTela}" >
				<h:outputText value="#{model.nomeTela}" />
			</p:column>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_Editavel}" >
				<h:outputText value="#{model.editavel}" />
			</p:column>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_Obrigatorio}" >
				<h:outputText value="#{model.obrigatorio}" />
			</p:column>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_Atributo}" >
				<h:outputText value="#{model.atributoClasse}" />
			</p:column>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_Tipo}" >
				<h:outputText value="#{model.tipoDado}" />
			</p:column>
			<p:column headerText="#{i18n.DescricaoEstendida_GridDado_Regras}" >
				<h:outputText value="#{model.regraDescricao}" />
			</p:column>
			<p:column headerText="#{i18n.Ator_Acoes}" style="width:40px;">
				<p:commandButton icon="ui-icon ui-icon-pencil" value="#{i18n.btn_Editar}"
					process="@this" update=":formEditarDado" action="#{deBean.preEditarDado(model.id)}" 
					onstart="spinner.show();" oncomplete="spinner.hide(); dialogoEditarDado.show();"/>
			</p:column>
			<p:column selectionMode="multiple" style="width:18px;text-align:center;"/>
		</p:dataTable>
	</div>
</f:view>